----********Untie Email Message....... Use this when user tie to the wrong KFID.
--
----765660  807201 / 807327 / 807376
--Select * from tblEmessage where (em_autoid=877451)
--select * from tbltask where trefid = 375215 *** Check for Can't close email
--825832 >> 352023, 8002024254
----update tblEmessage Set em_status = 'Pending' Where em_autoid =  866327 
--update tblEmessage Set em_lock = 0 Where em_autoid = 876058  And em_lock =1 
--
--UPDATE    TBLEMESSAGE
--SET              EM_CUSTID = NULL, EM_TYPE = NULL, EM_SUBTYPE = NULL, EM_LOCK=0,EM_PROCESSEDDATE = NULL, EM_PROCESSEDBY = NULL, EM_EVENTID = NULL, 
--                      CKFID = NULL,EM_STATUS = 'Open',EM_DATECLOSED=NULL,EM_CLOSEDBY=NULL
--WHERE     (EM_AUTOID =878474)

--select * from tblEmessage Where em_autoId = 764565 

--update tblEmessage Set Em_Status = 'Pending' Where em_autoId = 764565 
----**********Untie Mail/Telex message************
--
--756360 , Rajay

--10:30, 2:30,  4:30 Vijay
--Select * from tblmail where (m_autoid =112399)
--
--99310 and ID:99383

--UPDATE    tblmail Set m_lock = 0 Where M_Lock = 1 And m_autoId = 111533
--
--UPDATE    tblmail 
--SET              M_CustID = NULL, M_Type = NULL, M_SubType = NULL,M_Lock=0, M_ProcessedDate = NULL, M_ProcessedBy = NULL, M_EventID = NULL, 
--                      CKFID = NULL, M_Status = 'Open',m_dateclosed=null,m_closedby=null
--WHERE     (M_AutoID = 112400)

--
----****************Untie Fax
--
--Select * from tblfmessage where (fm_autoid=129828)
--
--UPDATE    tblfmessage
--SET              fm_CustID = NULL, fm_Type = NULL, fm_SubType = NULL, fm_Lock=0, fm_ProcessedDate = NULL, fm_ProcessedBy = NULL, fm_EventID = NULL, 
--                      CKFID = NULL, fm_Status = 'Open',fm_dateclosed=null,fm_closedby=null
--WHERE     (fm_AutoID = 129828)

--select * from tblFMessage Where fm_autoId = 115799
--
--update tblFMessage Set fm_lock = 0
--Where fm_autoId = 115799

use master;

Declare avar int
avar = 1
WHILe (avar=1)
Begin
Select '1'
End

declare @counter int set @counter = 0 while @counter < 10 begin print 'The counter is ' + cast(@counter as char) end select 'a'

a' or 'a' = 'a'; delete from tbluser where 'a' = 'a